package entity

// 节点
type HubNodeDefinition struct {
	ID           string   `gorm:"column:id" json:"-"`
	Icon         string   `gorm:"column:icon" json:"icon"`
	Name         string   `gorm:"column:name" json:"name"`
	OwnerName    string   `gorm:"column:owner_name" json:"ownerName"`
	OwnerType    string   `gorm:"column:owner_type" json:"ownerType"`
	OwnerRef     string   `gorm:"column:owner_ref" json:"ownerRef"`
	CreatorName  string   `gorm:"column:creator_name" json:"creatorName"`
	CreatorRef   string   `gorm:"column:creator_ref" json:"creatorRef"`
	Type         string   `gorm:"column:type" json:"type"`
	Description  string   `gorm:"column:description" json:"description"`
	Ref          string   `gorm:"column:ref" json:"ref"`
	SourceLink   string   `gorm:"column:source_link" json:"sourceLink"`
	DocumentLink string   `gorm:"column:document_link" json:"documentLink"`
	Versions     []string `gorm:"-" json:"versions"`
}

type HubNodeDefinitionVersion struct {
	ID               string `gorm:"column:id"`
	OwnerRef         string `gorm:"column:owner_ref"`
	Ref              string `gorm:"column:ref"`
	CreatorName      string `gorm:"column:creator_name"`
	CreatorRef       string `gorm:"column:creator_ref"`
	Version          string `gorm:"column:version"`
	ResultFile       string `gorm:"column:result_file"`
	Type             string `gorm:"column:type"`
	InputParameters  []byte `gorm:"column:input_parameters"`
	OutputParameters []byte `gorm:"column:output_parameters"`
	Spec             string `gorm:"column:spec"`
}

func (*HubNodeDefinition) TableName() string {
	return "hub_node_definition"
}

func (*HubNodeDefinitionVersion) TableName() string {
	return "hub_node_definition_version"
}
